Fish are ectotherms and hence their ability to interact with their environment, and acquire energy for growth and reproduction, strongly depends on temperature. In boreal areas, winter conditions prevail for a substantial portion of the year. As water temperature decreases, fishes become less active and move to deeper water. Because the temperature in deep water is approximately equal to mean annual air temperature and maintains in a range that is acceptable for fish surviving even when air temperatures drop below freezing point. Hence, the appropriate water depth should maintain in overwintering areas to make sure fish survival. However, humans have built a large number of hydraulic engineering on rivers to meet the needs of social and economic development, which result in runoff decrease in the downstream, especially in winter. The water depth in the fish overwintering areas was too shallow to overwinter. In recognition of these issue, this invention provides a novel method to control the gate based on the habitat requirement to make sure that fish could live through winters safely.